//
//  ITHTMLTableViewCell.m
//  InduceTool
//
//  Created by 魏延龙 on 2020/9/28.
//  Copyright © 2020 魏延龙. All rights reserved.
//

#import "ITHTMLTableViewCell.h"
#import <WebKit/WebKit.h>


@interface ITHTMLTableViewCell ()

@property (nonatomic, strong) WKWebView *webView;
@property (nonatomic, strong) UILabel * label;

@end

@implementation ITHTMLTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        self.label = [[UILabel alloc] init];
        self.label.numberOfLines = 0;
        
        self.webView = [[WKWebView alloc] init];
//        [self.contentView addSubview:self.webView];
        [self.contentView addSubview:self.label];
    }
    return self;
}
-(void)layoutSubviews {
//    self.webView.frame = self.bounds;
    self.label.frame = self.bounds;
}


-(void)sethtmlstr:(NSString *)html {
    [self.webView loadHTMLString:html baseURL:nil];
}

-(void)setattr:(NSAttributedString *)str {
    self.label.attributedText = str;
}

@end
